# -*- coding: utf-8 -*-
from filetransfer import ali_bucket


def upload_file2alioss(file_path,save_key):
    if type(file_path) == str:
        with open(file_path, 'rb') as fileobj:
            ali_bucket.put_object(save_key, fileobj)
    else:
        ali_bucket.put_object(save_key,file_path)

def upload_str2alioss(string,save_key):
    ali_bucket.put_object(save_key, string)

def upload_bytes2alioss(bytes_stream,save_key):
    ali_bucket.put_object(save_key, bytes_stream)
